package concurrency.thread;

public class TaskExecutor {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int i = 0;

		while (i < 50) {
			Thread t = new Thread(new Task(i), "task");
			t.start();
			i ++;
		}

//		Thread t = new Thread(new RunTask(), "runtask");
//		t.start();
	}
}

class RunTask implements Runnable{

	@Override
	public void run() {
		int i = 0;
		while (i < 50) {
			Task task = new Task(i);
			task.run();
			i ++;
		}
	}
}
